#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=4096;

void swap(int &a, int &b) {
  int t;
  t=a, a=b, b=t;
}

int main() {
  freopen("swap.in", "r", stdin);
  freopen("swap.out", "w", stdout);

  static int a[maxn+1], b[maxn+1], tar[maxn+1];
  int n;
  scanf("%d", &n);
  for (int i=1; i<=n; i++) {
    scanf("%d", a+i);
  }
  for (int i=1; i<=n; i++) {
    scanf("%d", b+i);
    tar[b[i]] = i;
  }

  int m=0;
  static int opt[maxn*maxn+1][2]; 
  for (int i=1; i<=n; i++) {
    for (int j=1; j<n-i+1; j++) {
      if (tar[a[j]]>tar[a[j+1]]) {
	m++;
	opt[m][0] = j;
	opt[m][1] = j+1;
	swap(a[j], a[j+1]);
      }
    }
  }
  
  printf("%d\n", m);
  for (int i=1; i<=m; i++) {
    printf("%d %d\n", opt[i][0], opt[i][1]);
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
